home *** CD-ROM | disk | FTP | other *** search
- Path: news.larc.nasa.gov!amiga-request
- From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
- Subject: v91i135: sregexp.library 11.1 - a library for regular expressions, Part01/02
- Reply-To: "J. Spencer" <bhgs@utcs.utoronto.ca>
- Newsgroups: comp.sources.amiga
- Message-ID: <comp.sources.amiga.v91i135@ab20.larc.nasa.gov>
- Date: 29 Jul 91 22:50:34 GMT
- Approved: tadguy@uunet.UU.NET (Tad Guy)
- X-Mail-Submissions-To: amiga@uunet.uu.net
- X-Post-Discussions-To: comp.sys.amiga.misc
-
- Submitted-by: "J. Spencer" <bhgs@utcs.utoronto.ca>
- Posting-number: Volume 91, Issue 135
- Archive-name: libraries/sregexp-11.1/part01
-
- [ includes uuencoded libraries ...tad ]
-
- 'sregexp.library' is a run time library of routines for doing wildcard
- pattern matching and wildcard path matching. It accepts a slight extension
- of the AmigaDOS wildcard syntax, including a not operator, and character
- sets. It has routines to test if a string matches a wildcard expression,
- and for scanning through all matches to a wildcarded AmigaDOS path. There
- are two nifty features to the path matching routines: '.../' means
- recursively scan all subdirectories, and may come anywhere in the path; and
- wildcards are allowed in the volume node part of the path! (DH?: would
- match all your hard drive partitions.)
-
- new from version 9.1 -> 11.1
-
- Fixed a couple of bugs.
-
- A null string is now equivalent to a '%' in all cases, so
- (cat|dog|) is the same as (cat|dog|%).
-
-
- #!/bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 2)."
- # Contents: BUGS_TO COPYRIGHT.NOTICE OVERVIEW clibrary.asm
- # compilation.notes dmakefile instillation.notes kludge.asm
- # revision.history sreg_version.c sreg_version.i sregexp.fd
- # sregexp.h sregexp.uu sregexp_protos.h sregexpbase.h sregexpbase.i
- # sregexps.uu sregexpsr.uu utils utils/bumprev.c utils/remlib.c
- # utils/try.c
- # Wrapped by tadguy@ab20 on Mon Jul 29 18:50:32 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'BUGS_TO' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'BUGS_TO'\"
- else
- echo shar: Extracting \"'BUGS_TO'\" \(94 characters\)
- sed "s/^X//" >'BUGS_TO' <<'END_OF_FILE'
- X
- XSend bug reports, comments, etc. to
- X
- X Jon Spencer.
- X
- X EMail: bhgs@gpu.utcs.utoronto.ca
- X
- END_OF_FILE
- if test 94 -ne `wc -c <'BUGS_TO'`; then
- echo shar: \"'BUGS_TO'\" unpacked with wrong size!
- fi
- # end of 'BUGS_TO'
- fi
- if test -f 'COPYRIGHT.NOTICE' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'COPYRIGHT.NOTICE'\"
- else
- echo shar: Extracting \"'COPYRIGHT.NOTICE'\" \(1083 characters\)
- sed "s/^X//" >'COPYRIGHT.NOTICE' <<'END_OF_FILE'
- X
- X The library 'sregexp.library', and all sources and documentation
- X relating to it included in this distribution are Copyright (c) 1991, by
- X Jon Spencer.
- X
- X Permission is given to redistribute any part or all of this
- X distribution, either modified or unmodified, PROVIDED THAT:
- X - the distribution is on a not-for-profit basis,
- X - this copyright notice is included in the distribution,
- X - and if a modified version is distributed, clear indication
- X that it is modified is included.
- X
- X All other rights are reserved by the author, Jon Spencer.
- X
- X
- X(disclaimer borrowed, somewhat modified, from the DICE distribution)
- X
- X PROGRAM DISCLAIMER: THE LIBRARY IS PROVIDED "AS IS" WITHOUT WARRANTY OF
- X ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
- X THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- X PURPOSE. THE ENTIRE RISK AS TO THE RESULTS AND PERFORMANCE OF ANY
- X PROGRAM IS ASSUMED BY YOU. Should the program prove defective, you
- X assume the entire cost of all necessary servicing, repair, or
- X correction.
- X
- END_OF_FILE
- if test 1083 -ne `wc -c <'COPYRIGHT.NOTICE'`; then
- echo shar: \"'COPYRIGHT.NOTICE'\" unpacked with wrong size!
- fi
- # end of 'COPYRIGHT.NOTICE'
- fi
- if test -f 'OVERVIEW' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'OVERVIEW'\"
- else
- echo shar: Extracting \"'OVERVIEW'\" \(792 characters\)
- sed "s/^X//" >'OVERVIEW' <<'END_OF_FILE'
- X
- X'sregexp.library' is a run time library of routines for doing wildcard
- Xpattern matching and wildcard path matching. It accepts a slight extension
- Xof the AmigaDOS wildcard syntax, including a not operator, and character
- Xsets. It has routines to test if a string matches a wildcard expression,
- Xand for scanning through all matches to a wildcarded AmigaDOS path. There
- Xare two nifty features to the path matching routines: '.../' means
- Xrecursively scan all subdirectories, and may come anywhere in the path; and
- Xwildcards are allowed in the volume node part of the path! (DH?: would
- Xmatch all your hard drive partitions.)
- X
- X new from version 9.1 -> 11.1
- X
- X Fixed a couple of bugs.
- X
- X A null string is now equivalent to a '%' in all cases, so
- X (cat|dog|) is the same as (cat|dog|%).
- X
- END_OF_FILE
- if test 792 -ne `wc -c <'OVERVIEW'`; then
- echo shar: \"'OVERVIEW'\" unpacked with wrong size!
- fi
- # end of 'OVERVIEW'
- fi
- if test -f 'clibrary.asm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'clibrary.asm'\"
- else
- echo shar: Extracting \"'clibrary.asm'\" \(11630 characters\)
- sed "s/^X//" >'clibrary.asm' <<'END_OF_FILE'
- X
- X;**************************************************************************
- X;* *
- X;* sregexp.library -- pattern matching run time library. *
- X;* *
- X;* *
- X;* Startup module: this is heavily copied from the sample.library *
- X;* in the RKM includes and autodocs. *
- X;* This also relies on some features of dice (in particular, registered *
- X;* args and features of the linker.) Be carefull if you make it with *
- X;* something else. *
- X;* *
- X;* Created: April 20, 1991 *
- X;* *
- X;**************************************************************************
- X
- X CODE sregexp.start
- X
- X INCLUDE "sregexpbase.i"
- X INCLUDE "exec/initializers.i"
- X INCLUDE "libraries/dos.i"
- X INCLUDE "exec/resident.i"
- X INCLUDE "exec/lists.i"
- X INCLUDE "exec/alerts.i"
- X INCLUDE "sreg_version.i"
- X
- X;--------------------------------------------------------------------
- X; some generally usefull macros hiding _LVO's
- X;--------------------------------------------------------------------
- XCALLSYS macro
- X jsr _LVO\1(a6)
- X endm
- X
- XXLIB macro
- X xref _LVO\1
- X endm
- X
- X;--------------------------------------------------------------------
- X; Declare the library calls I use. The _LVO's are brought in
- X; from amiga.lib
- X;--------------------------------------------------------------------
- X XLIB OpenLibrary
- X XLIB CloseLibrary
- X XLIB Alert
- X XLIB FreeMem
- X XLIB Remove
- X
- X;------ defined in Amiga.lib ------
- X xref _AbsExecBase
- X
- X;------ defined in the c source, the id string of my library. ------
- X xref _idString
- X
- X
- X
- X
- X;--------------------------------------------------------------------
- X; Make some stuff visible for debuging.
- X;--------------------------------------------------------------------
- X xdef Init
- X xdef EndCode
- X xdef RomTag
- X xdef funcTable
- X xdef dataTable
- X xdef InitRoutine
- X
- X xdef Open
- X xdef Close
- X xdef Expunge
- X xdef Reserved
- X
- X;--------------------------------------------------------------------
- X; The links to the c code are in the file kludge.asm, because the
- X; assembler I use doesn't like to make symbols starting with a @.
- X; But thats what DICE starts it's regargs routines with, so...
- X; I make the links with das, which comes with dice.
- X;
- X; my library routines
- X;--------------------------------------------------------------------
- X xref parsesregexp
- X xref freesregexp
- X xref matchsregexp
- X xref matchnsregexp
- X xref iswild
- X xref anchorpath
- X xref nextfile
- X xref buildpath
- X xref freespathinfo
- X
- X
- X
- X
- X
- X************************************************************************
- X* Ok, so much for the preamble, we can actually start to generate *
- X* some code now. The very first thing we should do is return an *
- X* error if someone tries to run us like a program, seeing as we *
- X* will be a perfectly legal AmigaDos load module. *
- X************************************************************************
- X
- XStart:
- X moveq.l #-1,d0
- X rts
- X
- X
- X;--------------------------------------------------------------------
- X; Ok, here's what exec is going to look for to tell it that we are
- X; a library.
- X;--------------------------------------------------------------------
- XRomTag:
- X dc.w RTC_MATCHWORD ; magic
- X dc.l RomTag ; pointer back to magic
- X dc.l EndCode ; keep looking from here
- X dc.b RTF_AUTOINIT ; yes, autoinit me.
- X dc.b VERSION ; version number
- X dc.b NT_LIBRARY ; I'm a library
- X dc.b 0 ; no priority (typical)
- X dc.l sregexpname ; I have a name
- X dc.l _idString ; let's see some ID
- X dc.l Init ; start me up
- X
- X
- X;--------------------------------------------------------------------
- X; Ok, heres the table of 4 vectors exec is going to look for
- X; to autoinit me.
- X;
- X; We are word alligned here.
- X;--------------------------------------------------------------------
- XInit:
- X dc.l SregExpBase_SIZE ; size of library structure
- X dc.l funcTable ; table of all my routines.
- X dc.l dataTable ; LibStructure init data
- X dc.l InitRoutine ; Where to start me.
- X
- X
- X;--------------------------------------------------------------------
- X; This is the list of functions in my library.
- X;--------------------------------------------------------------------
- XfuncTable:
- X dc.l Open
- X dc.l Close
- X dc.l Expunge
- X dc.l Reserved
- X
- X; my own little gems.
- X dc.l parsesregexp
- X dc.l freesregexp
- X dc.l matchsregexp
- X dc.l matchnsregexp
- X dc.l iswild
- X dc.l anchorpath
- X dc.l nextfile
- X dc.l buildpath
- X dc.l freespathinfo
- X dc.l -1 ; end of the list.
- X
- X;--------------------------------------------------------------------
- X; heres the stuff to initialise my Library structure.
- X;--------------------------------------------------------------------
- XdataTable:
- X INITBYTE LN_TYPE,NT_LIBRARY
- X INITLONG LN_NAME,sregexpname
- X INITBYTE LIB_FLAGS,LIBF_SUMUSED|LIBF_CHANGED
- X INITWORD LIB_VERSION,VERSION
- X INITWORD LIB_REVISION,REVISION
- X INITLONG LIB_IDSTRING,_idString
- X dc.l 0
- X
- X
- X
- X*******************************************************************
- X* Ok, so now were really ready to get cooking. *
- X* This routine is called when the library is first linked into *
- X* the exec LibList. The Library structure has already been *
- X* initialised as per the dataTable instructions. *
- X* *
- X* When called, d0 has our library base and the segment list is *
- X* pointed to by a0; a6 is a pointer to SysBase. *
- X*******************************************************************
- X
- XInitRoutine:
- X move.l a4,-(sp) ; put the lib pointer
- X move.l d0,a4 ; in a convinient place
- X
- X move.l a6,sb_SysBase(a4) ; save SysBase
- X move.l a0,sb_SegList(a4) ; save our seglist
- X
- X lea.l dosname(pc),a1 ; try and open up
- X moveq.l #0,d0 ; dos.library
- X CALLSYS OpenLibrary
- X
- X move.l d0,sb_DOSBase(a4) ;save dos
- X bne.s 1$
- X
- X
- X ALERT AG_OpenLib|AO_DOSLib ; couldn't get dos!!!
- X
- X;------- That's all there is to do. --------
- X1$
- X move.l a4,d0
- X move.l (sp)+,a4
- X rts
- X
- X
- X
- X***********************************************************************
- X* So good so far. Now come the 4 standard library routines that *
- X* every good library must have. Each of these (in fact all of the *
- X* library calls) comes with the pointer to our library base in a6. *
- X***********************************************************************
- X
- X;----------------------------------------------------------------------
- X; To open the library, all we have to do is up the count of current
- X; users and reset the delayed expunge flag. This returns the library
- X; pointer on d0 if we successfully opened (which is always the case).
- X;----------------------------------------------------------------------
- XOpen:
- X addq.w #1,LIB_OPENCNT(a6)
- X bclr #LIBB_DELEXP,LIB_FLAGS(a6)
- X move.l a6,d0
- X rts
- X
- X
- X
- X
- X;----------------------------------------------------------------------
- X; When we close the library, we decrease the count of current
- X; users. If this has reached zeros, then we check the delayed
- X; expunge flag and clean up if it is set.
- X; If this routine returns 0 then that's that. If the return value
- X; is non-zero, it should be the segment pointer passed to the
- X; initialization routine, so we can be unloaded.
- X;----------------------------------------------------------------------
- XClose:
- X ;--- set up the return value, which will be altered ---
- X ;--- if we decide to do a delayed expunge. ---
- X moveq.l #0,d0
- X subq.w #1,LIB_OPENCNT(a6)
- X bne.s 1$
- X btst #LIBB_DELEXP,LIB_FLAGS(a6)
- X beq.s 1$
- X
- X; --- take a shortcut into the Expunge routine that doesn't ---
- X; --- redo the tests we just did. ---
- X bsr.s ReallyExpunge
- X
- X1$
- X; --- at this point, d0 is zero if we didn't expunge, otherwise ---
- X; --- it the address of our segment list. ---
- X rts
- X
- X
- X
- X;----------------------------------------------------------------------
- X; Ok, so now we want to try to unload. First check if there
- X; are still any current openers, if so, just set the delayed
- X; expunge flag, and we'll go away when everyone closes us.
- X; Otherwise, clean up my resources and return the seg list to
- X; be unloaded
- X;----------------------------------------------------------------------
- XExpunge:
- X tst.w LIB_OPENCNT(a6)
- X beq.s ReallyExpunge
- X
- X bset #LIBB_DELEXP,LIB_FLAGS(a6)
- X moveq.l #0,d0 ;don't unload me please
- X rts
- X
- XReallyExpunge:
- X movem.l d2/a5,-(sp)
- X move.l a6,a5
- X move.l sb_SysBase(a5),a6
- X
- X move.l sb_SegList(a5),d2 ;save seglist.
- X
- X move.l a5,a1 ;remove the library
- X REMOVE ;from the system list
- X
- X move.l sb_DOSBase(a5),a1
- X CALLSYS CloseLibrary ;close dos.
- X
- X moveq.l #0,d0
- X move.l a5,a1
- X move.w LIB_NEGSIZE(a5),d0
- X sub.l d0,a1
- X add.w LIB_POSSIZE(a5),d0
- X
- X CALLSYS FreeMem ;free our library base.
- X
- X move.l d2,d0 ;unload us.
- X
- X movem.l (sp)+,d2/a5
- X rts
- X
- X
- X;----------------------------------------------------------------------
- X; This is the reserved vector. Just return 0.
- X;----------------------------------------------------------------------
- XReserved:
- X moveq.l #0,d0
- X rts
- X
- X
- X
- X**********************************************************************
- X* That's all of the standard stuff. As discussed above, the links *
- X* to the c code are in the file kludge.asm *
- X**********************************************************************
- X
- X
- X
- X
- X
- X
- X
- X;----------------------------------------------------------------------
- X; Here are some stings used in the above. I put them at the end so
- X; so I don't have to worry about alignment.
- X;----------------------------------------------------------------------
- Xdosname DOSNAME
- X
- Xsregexpname SREGEXPNAME
- X
- X;----------------------------------------------------------------------
- X; The end of the code, where exec can start looking for more RomTag
- X; structures if it wants to.
- X;----------------------------------------------------------------------
- X EVEN
- XEndCode:
- X
- X
- X
- X
- X
- X**********************************************************************
- X* *
- X* Now comes the clever part. Dice (and the others, I think) *
- X* references there global data from register a4. What I do *
- X* to have easy access to the Library structure data from the *
- X* c code, is transfer a6 to a4 on each library call and then *
- X* define the various things I want to access as offsets to *
- X* this, in effect, tricking dice into thinking they're global *
- X* variables. The real benifit of this is I don't need my own *
- X* custom links to the Exec and DOS library routines, because *
- X* there exists perfectly valid global variables SysBase and *
- X* DosBase. *
- X* *
- X**********************************************************************
- X
- X DATA data
- X
- X;---------------------------------------------------------------------
- X; This one is a little funny, it is the actual instance of the
- X; structure, and not a pointer to it. It should be declared in
- X; the c code as 'extern struct SregExpBase SregExpBase;' and then
- X; referenced with the '.' and not the '->'. This may not work
- X; I haven't tried it yet.
- X;----------------------------------------------------------------------
- X_SregExpBase equ 0
- X xdef _SregExpBase
- X
- X;--- These are perfectly ordinary pointers ---
- X_SysBase equ sb_SysBase
- X xdef _SysBase
- X
- X_DOSBase equ sb_DOSBase
- X xdef _DOSBase
- X
- X end
- X
- END_OF_FILE
- if test 11630 -ne `wc -c <'clibrary.asm'`; then
- echo shar: \"'clibrary.asm'\" unpacked with wrong size!
- fi
- # end of 'clibrary.asm'
- fi
- if test -f 'compilation.notes' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'compilation.notes'\"
- else
- echo shar: Extracting \"'compilation.notes'\" \(1301 characters\)
- sed "s/^X//" >'compilation.notes' <<'END_OF_FILE'
- X
- X
- X As it says in various places in the source, this whole thing is kind
- X of DICE dependent. If you know what you are doing you should be
- X able to get it to compile under anything.
- X
- X The c source was not written with an eye to portability, but I don't
- X think it is too bad.
- X
- X To make under another compiler you will almost definitely have to change
- X the file kludge.asm, were the jump vectors into the code are. Most
- X likely you'll have to take the register parameters and stuff
- X them onto the stack.
- X
- X The easiest thing to do is just type 'dmake install' and trust
- X my compilations.
- X
- X PLEASE do not distribute modified versions, and if you do make sure
- X the copyright notice is left intact AND you state clearly it is
- X a modified version.
- X
- X
- X Note that I made everything under 1.3 (I don't have 2.0). There
- X are a few things to consider, however. I have made my own 1.3 version
- X of the 'clib' directory, which is new to 2.0. This also allowed
- X me to make my own 1.3 registered args amigasr13.lib linker
- X library. If you want to remake this under 1.3 with dice, you will
- X have to either come up with these yourself, or modify kludge.asm
- X to stuff the parameters on to the stack. Under 2.0 everything should
- X go, but no guarantees.
- X
- END_OF_FILE
- if test 1301 -ne `wc -c <'compilation.notes'`; then
- echo shar: \"'compilation.notes'\" unpacked with wrong size!
- fi
- # end of 'compilation.notes'
- fi
- if test -f 'dmakefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'dmakefile'\"
- else
- echo shar: Extracting \"'dmakefile'\" \(1550 characters\)
- sed "s/^X//" >'dmakefile' <<'END_OF_FILE'
- X
- XOD = OBJS:sreg/
- X
- XCSRC = sregexp.c sreg_version.c spath.c
- XCOBJ = $(CSRC:"*.c":"$(OD)*.o")
- XOBJ = $(OD)clibrary.o $(OD)kludge.o $(COBJ)
- XJUNK = utils/try utils/remlib utils/bumprev
- XJUNKSRC = $(JUNK:"*":"*.c")
- X
- XLINKLIBS = amigasr13.lib cr.lib
- X
- XLIBRARY = sregexp.library
- X
- XCOPTS = -c -mRR -mS -proto
- X#COPTS = -c -mRR -mS -proto -D __DEBUG__
- X#COPTS = -c -mRR -mS -proto -D __DEBUG__ -D __MEMCHECK__
- X
- Xall : sregexpsr.lib sregexps.lib $(JUNK) $(LIBRARY)
- X
- X$(JUNK) : $(JUNKSRC)
- X dcc -mRR -r -lsregexpsr -o %(left) %(right)
- X
- X$(LIBRARY) : $(OBJ)
- X -Delete >NIL: %(left)
- X dlink -o %(left) $(OBJ) $(LINKLIBS)
- X utils/remlib $(LIBRARY)
- X Protect %(left) -E
- X Copy $(LIBRARY) Libs:
- X
- X$(OD)clibrary.o : clibrary.asm sreg_version.i
- X -Delete >NIL: %(left)
- X a68k -q -iAINC: -o%(left) clibrary.asm
- X
- X$(OD)kludge.o : kludge.asm
- X -Delete >NIL: %(left)
- X das -o%(left) %(right)
- X
- X$(COBJ) : $(CSRC)
- X -Delete >NIL: %(left)
- X dcc $(COPTS) -o %(left) %(right)
- X
- Xsregexpsr.lib : sregexp.fd sregexp_protos.h
- X -Delete >NIL: %(left)
- X fdtolib -mr sregexp.fd -o %(left) -h sregexp_protos.h
- X
- Xsregexps.lib : sregexp.fd
- X -Delete >NIL: %(left)
- X fdtolib sregexp.fd -o %(left)
- X
- Xsreg_version.i : $(CSRC) clibrary.asm kludge.asm utils/bumprev
- X utils/bumprev
- X touch sreg_version.i
- X
- Xclean :
- X -Delete $(JUNK)
- X -Delete $(OBJ)
- X -Delete sregexpsr.lib sregexps.lib
- X
- Xinstall :
- X Copy $(LIBRARY) Libs:
- X Copy sregexpbase.h dinclude:pd/libraries
- X Copy sregexp_protos.h dinclude:pd/clib
- X Copy sregexps.lib dlib:
- X Copy sregexpsr.lib dlib:
- END_OF_FILE
- if test 1550 -ne `wc -c <'dmakefile'`; then
- echo shar: \"'dmakefile'\" unpacked with wrong size!
- fi
- # end of 'dmakefile'
- fi
- if test -f 'instillation.notes' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'instillation.notes'\"
- else
- echo shar: Extracting \"'instillation.notes'\" \(757 characters\)
- sed "s/^X//" >'instillation.notes' <<'END_OF_FILE'
- X
- X
- X If you have dmake, then just change to this directory and
- X type 'dmake install' and all of the files will be copied to
- X the appropriate place (if not you can edit the dmake file)
- X
- X If not, heres where they should go:
- X
- X sregexp.library should be copied to LIBS:
- X
- X sregexps.lib should go to DLIB: If you use a different
- X sregexpsr.lib compiler, you will have to use whatever
- X utility exists to turn the fd file into
- X your kind of library.
- X
- X sregexpbase.h should go in the 'libraries' directory,
- X where ever you keep your Amiga include
- X files.
- X
- X sregexp_protos.h Under 2.0 this goes in 'clib' I compiled
- X everything under 1.3, but I have a fake
- X 1.3 clib directory of my own making.
- X Basically put it where you want.
- X
- END_OF_FILE
- if test 757 -ne `wc -c <'instillation.notes'`; then
- echo shar: \"'instillation.notes'\" unpacked with wrong size!
- fi
- # end of 'instillation.notes'
- fi
- if test -f 'kludge.asm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'kludge.asm'\"
- else
- echo shar: Extracting \"'kludge.asm'\" \(1876 characters\)
- sed "s/^X//" >'kludge.asm' <<'END_OF_FILE'
- X
- X;-------------------------------------------------------------------
- X; Here are the links to the c code. Anything that dice can't make
- X; registered arguement versions of would have to stick the stuff onto the
- X; stack. Note that the fd file and dice must both have the same
- X; idea of what gets passed in what. I will perhaps automate that
- X; one day. For now just be carefull.
- X;-------------------------------------------------------------------
- X
- X section kludge,code
- X
- X xdef parsesregexp
- X xref @parsesregexp
- Xparsesregexp:
- X move.l a4,-(sp)
- X move.l a6,a4
- X jsr @parsesregexp(pc)
- X move.l (sp)+,a4
- X rts
- X
- X xdef freesregexp
- X xref @freesregexp
- Xfreesregexp:
- X move.l a4,-(sp)
- X move.l a6,a4
- X jsr @freesregexp(pc)
- X move.l (sp)+,a4
- X rts
- X
- X xdef matchsregexp
- X xref @matchsregexp
- Xmatchsregexp:
- X move.l a4,-(sp)
- X move.l a6,a4
- X jsr @matchsregexp(pc)
- X move.l (sp)+,a4
- X rts
- X
- X xdef matchnsregexp
- X xref @matchnsregexp
- Xmatchnsregexp:
- X move.l a4,-(sp)
- X move.l a6,a4
- X jsr @matchnsregexp(pc)
- X move.l (sp)+,a4
- X rts
- X
- X xdef iswild
- X xref @iswild
- Xiswild:
- X move.l a4,-(sp)
- X move.l a6,a4
- X jsr @iswild(pc)
- X move.l (sp)+,a4
- X rts
- X
- X xdef anchorpath
- X xref @anchorpath
- Xanchorpath:
- X move.l a4,-(sp)
- X move.l a6,a4
- X jsr @anchorpath(pc)
- X move.l (sp)+,a4
- X rts
- X
- X xdef nextfile
- X xref @nextfile
- Xnextfile:
- X move.l a4,-(sp)
- X move.l a6,a4
- X jsr @nextfile(pc)
- X move.l (sp)+,a4
- X rts
- X
- X xdef buildpath
- X xref @buildpath
- Xbuildpath:
- X move.l a4,-(sp)
- X move.l a6,a4
- X jsr @buildpath(pc)
- X move.l (sp)+,a4
- X rts
- X
- X xdef freespathinfo
- X xref @freespathinfo
- Xfreespathinfo:
- X move.l a4,-(sp)
- X move.l a6,a4
- X jsr @freespathinfo(pc)
- X move.l (sp)+,a4
- X rts
- X
- X end
- END_OF_FILE
- if test 1876 -ne `wc -c <'kludge.asm'`; then
- echo shar: \"'kludge.asm'\" unpacked with wrong size!
- fi
- # end of 'kludge.asm'
- fi
- if test -f 'revision.history' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'revision.history'\"
- else
- echo shar: Extracting \"'revision.history'\" \(1088 characters\)
- sed "s/^X//" >'revision.history' <<'END_OF_FILE'
- X
- X version 11.1
- X Everything seems to be ok again.
- X
- X version 10.xx
- X Fixed a minor bug to make the null string equivalent to '%'
- X in all cases. Means (cat|dog|) is equivalent to (cat|dog|%)
- X and not illegal, as it was before. Also fixed a bug which
- X occasionally caused a GURU. Sometimes I would trash memory
- X by terminating a string with 2 null's (Thanks to Stefan Becker
- X for the report and solution of this one). Fixed a bug that
- X would cause it to loose memory if an illegal path was given
- X to AnchorPath. This same bug would also cause the occasional
- X GURU depending on when exec decided to clean up memory.
- X
- X version 9.x
- X First version ready for general release, everything seems
- X to work ok.
- X
- X versions 4.0 - 8.xx
- X Various steps on the long road to getting the path matching
- X routines to actually work.
- X
- X version 2.0 - 3.xx
- X Porting of the pattern matching routines from a link time
- X library to a run time library.
- X
- X version 1.xx
- X Figuring out how to make a @&*! Amiga run time library
- X go. WHY DOES IT GURU WHEN I EXPUNGE, AHHHHH! Well
- X it worked in the end.
- END_OF_FILE
- if test 1088 -ne `wc -c <'revision.history'`; then
- echo shar: \"'revision.history'\" unpacked with wrong size!
- fi
- chmod +x 'revision.history'
- # end of 'revision.history'
- fi
- if test -f 'sreg_version.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sreg_version.c'\"
- else
- echo shar: Extracting \"'sreg_version.c'\" \(69 characters\)
- sed "s/^X//" >'sreg_version.c' <<'END_OF_FILE'
- X
- X
- Xconst __far char idString[] = "sreglib 11.1 ("__DATE__")\x0d\x0a";
- END_OF_FILE
- if test 69 -ne `wc -c <'sreg_version.c'`; then
- echo shar: \"'sreg_version.c'\" unpacked with wrong size!
- fi
- # end of 'sreg_version.c'
- fi
- if test -f 'sreg_version.i' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sreg_version.i'\"
- else
- echo shar: Extracting \"'sreg_version.i'\" \(46 characters\)
- sed "s/^X//" >'sreg_version.i' <<'END_OF_FILE'
- X
- XVERSION equ 11
- XREVISION equ 1
- X
- X
- X
- X
- X
- X
- END_OF_FILE
- if test 46 -ne `wc -c <'sreg_version.i'`; then
- echo shar: \"'sreg_version.i'\" unpacked with wrong size!
- fi
- # end of 'sreg_version.i'
- fi
- if test -f 'sregexp.fd' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sregexp.fd'\"
- else
- echo shar: Extracting \"'sregexp.fd'\" \(279 characters\)
- sed "s/^X//" >'sregexp.fd' <<'END_OF_FILE'
- X##base _SregExpBase
- X##bias 30
- X##public
- XParseSregExp(p)(a0)
- XFreeSregExp(p)(a0)
- XMatchSregExp(p,p1,n)(a0,a1,d0)
- XMatchNSregExp(p,p1,n)(a0,a1,d0,d1)
- XIsWild(p)(a0)
- XAnchorPath(anchor,path)(a0,a1)
- XNextFile(p1,p2,n,n1)(a0,a1,d0,d1)
- XBuildPath(p1,p2,n)(a0,a1,d0)
- XFreeSpathInfo(p)(a0)
- X##end
- END_OF_FILE
- if test 279 -ne `wc -c <'sregexp.fd'`; then
- echo shar: \"'sregexp.fd'\" unpacked with wrong size!
- fi
- # end of 'sregexp.fd'
- fi
- if test -f 'sregexp.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sregexp.h'\"
- else
- echo shar: Extracting \"'sregexp.h'\" \(2201 characters\)
- sed "s/^X//" >'sregexp.h' <<'END_OF_FILE'
- X
- X/* This is used for COMPILING sregexp.library, it should not be included
- X if you just USE the library. See sregexpbase.h */
- X
- X#include <stddef.h>
- X#include <stdlib.h>
- X#include <string.h>
- X#include <ctype.h>
- X#include <clib/exec_protos.h>
- X#include <clib/dos_protos.h>
- X#include <libraries/dosextens.h>
- X#include "sregexpbase.h"
- X
- X#define TRUE 1
- X#define FALSE 0
- X
- X
- X#define MEM_ERROR ERROR_NO_FREE_STORE /* report no mem */
- X#define ILLEGAL_ERR ERROR_INVALID_COMPONENT_NAME /* bad sregexp */
- X
- X
- X/* some handy fingersaving macros. */
- X#define realen(a) (((a)->sre_Flag&(SRF_REPEAT|SRF_NOT))?0:(a)->sre_MinLen)
- X#define isfixed(s) (((s)->sre_Flag&(SRF_REPEAT|SRF_NOT|SRF_FIXLEN))==SRF_FIXLEN)
- X#define matchset(s,c) ((s)->sre_Data.setchar[(c)/8] & 1 << (c)%8)
- X
- X#ifdef __MEMCHECK__
- X
- X#define getmem(a) checkmem(a,__BASE_FILE__,__LINE__)
- X#define freemem(p,s) freecheck(p,s,__BASE_FILE__,__LINE__)
- X
- Xextern void *checkmem(int, char *, int);
- Xextern void freecheck(void *, int, char *, int);
- X
- X#else
- X
- X#define getmem(a) AllocMem(a,0)
- X#define freemem(p,s) FreeMem(p,s)
- X
- X#endif
- X
- X
- Xstatic struct SregExp * parsesub(char **, char);
- Xstatic struct SregExp * makesum(struct SregList *, int);
- Xstatic struct SregExp * makeor(struct SregList *, int);
- Xstatic struct SregExp * parseone(char **, char);
- Xstatic char onechar(char **, char);
- Xstatic struct SregExp * makenull(void);
- Xstatic char * makeset(char **);
- Xstatic int matchsum(struct SregExp *[], int, char *, int, int);
- Xstatic void report(int);
- Xstatic struct SpathNode * makespathnode(BPTR, char *, struct SregList *);
- Xstatic void freespathnode(struct SpathNode *);
- Xstatic struct SregList * parsepath(char *);
- X
- Xextern struct SregExp * parsesregexp(char *);
- Xextern void freesregexp(struct SregExp *);
- Xextern int matchsregexp(char *, struct SregExp *, int);
- Xextern int matchnsregexp(char *, struct SregExp *, int, int);
- Xextern int iswild(char *);
- Xextern struct SpathInfo * anchorpath(char *, char *);
- Xextern int nextfile(struct SpathInfo *, char *, int, int);
- Xextern int buildpath(struct SpathInfo *, char *, int);
- Xextern void freespathinfo(struct SpathInfo *);
- X
- END_OF_FILE
- if test 2201 -ne `wc -c <'sregexp.h'`; then
- echo shar: \"'sregexp.h'\" unpacked with wrong size!
- fi
- # end of 'sregexp.h'
- fi
- if test -f 'sregexp.uu' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sregexp.uu'\"
- else
- echo shar: Extracting \"'sregexp.uu'\" \(12387 characters\)
- sed "s/^X//" >'sregexp.uu' <<'END_OF_FILE'
- Xbegin 600 sregexp.library
- XM```#\P`````````!``````````````AX```#Z0``"'AP_TYU2OP````$```!@
- XM6H`+"0````%*```0Y````!X````N````+@```&8```"2````R@```-@```#LM
- XM```!.@```5P```%H```!=````8````&,```!F````:0```&P```!O/_____@,
- XM```("0#````*```!2N````X&`-```!0`"]```!8``<```!@``!#D`````"\,W
- XM*$`I3@`B*4@`*D/Z`)YP`$ZN_=@I0``F9A9(YP$&+CP``X`'+'@`!$ZN_Y1,P
- XMWV"`(`PH7TYU4FX`(`BN``,`#B`.3G5P`%-N`"!F"@@N``,`#F<"81).=4INL
- XM`"!G"@CN``,`#G``3G5(YR`$*DXL;0`B)"T`*B)-(%$B:0`$(H@A20`$(FT`B
- XM)DZN_F)P`")-,"T`$)/`T&T`$DZN_RX@`DS?(`1.=7``3G5D;W,N;&EB<F%RP
- XM>0!S<F5G97AP+FQI8G)A<GD`3G$O#"A.3KH`<BA?3G4O#"A.3KH(W"A?3G4OD
- XM#"A.3KH)1"A?3G4O#"A.3KH)7BA?3G4O#"A.3KH/"BA?3G4O#"A.3KH/9BA?<
- XM3G4O#"A.3KH5>BA?3G4O#"A.3KH8X"A?3G4O#"A.3KH9LBA?3G4C?B@I6UT_'
- XM)7PG*@!.5?_\*TC__'``0>W__$ZZ``HB0"`)3EU.=4CG.#(D`$Y5__`K2/_\?
- XM<``K0/_TE<IV`'@`8``!)"!M__P@4`P0`'QF$$Z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$@D`'H$0J<B`N6!(`%0@"(?3KH<:BQ`(`YF#'!G3KH+I'``4
- XM8```Y!R\``8=?`````$M0@`$=@!@``#`2H-F(B!2$"@``4B`2,!R`\"!9P9XP
- XM`&```'(@4C`H``)(P"@`8&0@4A(H``%(@4C!?`/"AF<$<`!@"B!2,B@``DC!T
- XM(`&PA&=">@`@4A(H``%(@4C!?`/"AF<$<`!@"B!2,B@``DC!(`&PA&P>(%(0[
- XM*``!2(!(P'(#P(%G!'@`8`H@4C`H``)(P"@`(%(2*``!2(%(P7P'PH9\!+R!_
- XM9@1P!&`"<`#*`"`#Y8`MD@@()FH`!'`(($I.NAN:)$M2@[2#;@#_/CU$``*+X
- XM+@`!(`Y,WTQ\3G5(YS`R)$@D`$Y5__P@4A`0D#P`*F<``3YJ))`\`-9G``%\4
- XMD#P`(V<\50!G``%85P!G``"04P!G``%D8``!<)`\`!5G``#@D#P`'&<``(A5Y
- XM`&<``4J0/``?9P`!0E4`9T)@``%*4I)P`"!*3KK_E"9`(`MF!G``8``!\@@K\
- XM`````6<6(#P```#23KH**B!+3KH#J'``8``!U`CK``$``6```<A2DG``($I.5
- XMNO]6)D`@"V8&<`!@``&T".L````!8``!J%*2<"D@2DZZ^Q(F0%*28``!EE*2O
- XM<@!P"$ZZ&I(F0"(+9@QP9TZZ"<QP`&```7P6O``!%WP`!``!-WP``0`"($I.]
- XMN@'F)T``!$JK``1F#G`$($M.NAIH<`!@``%.4I)@``%&4I)R`'`(3KH:0B9`D
- XM(@MF#'!G3KH)?'``8``!+!:\``(7?``$``$W?``!``)@``$64I)R`'`(3KH:)
- XM$B9`(@MF#'!G3KH)3'``8```_!:\``(7?``&``$W?``!``)@``#F4I).N@#J7
- XM)D`@"V8``-AP`&```-1@``#.(#P```#23KH)$'``8```P'(`<`A.NAF\)D`B/
- XM"V8,<&=.N@CV<`!@``"F%WP`!``!2@)F&G``($I.N@#*%T``!!:\``,W?``!$
- XM``)@``"`*U+__'8`8`)2@W``0>W__$ZZ`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80``,B`!X
- XM3G5*@6L(2H!K$F```")$@4J`:Q)A```81(!.=42`80``#D2`3G5$@&````1.&
- XM<4J!9QY(04I!9D(O`DA!)`"$P6D4(@)"04A!<``P`B0?3G4B`'#_3G4O`R0`?
- XM0D)(0H3!-@)(0T)#-`"$P38"(`-"0DA"(@(F'R0?3G5(YS@`)`!"0DA"A,$V`
- XM`G0`-`/&P4A!.`+(P4A#UH20@VL*(@`@`DS?`!Q.=5."T(%K^B(`(`),WP`<1
- XM3G4B2&`"4HA*$&;Z(`B0B4YU2H!F&'``8"1@$DH!9P93@$J`9@1P`&`44HA2D
- XMB1(0LA%GZ+(19`1P_V`"<`%.=4YQ+PHD2&`$4HE2B!"12A!F]B`*)%].=4YQP
- XM8`P2`+(09@0@"&`04HA*$&;P2H!F!"`(8`)P`$YU3G%(YR`P2H!F&'``8%!@#
- XM$DH!9P93@$J`9@1P`&!`4HA2B1(0=``4`47Z`D74PG0`%!%'^@([UL(4$K03Y
- XM9])T`!0!1_H"*];"=``4$47Z`B'4PA03M!)D!'#_8`)P`4S?#`1.=4YQ``0$U
- XM!`0$!`0$!$1$1$1$!`0$!`0$!`0$!`0$!`0$!`0$0!`0$!`0$!`0$!`0$!`08
- XM$!D9&1D9&1D9&1D0$!`0$!`0DY.3DY.3DY.3DY.3DY.3DY.3DY.3DY.3DY,0X
- XM$!`0$!`S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,Q`0$!`$````````````"
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM``````````````````````````````````````````````$"`P0%!@<("0H+"
- XM#`T.#Q`1$A,4%187&!D:&QP='A\@(2(C)"4F)R@I*BLL+2XO,#$R,S0U-C<XZ
- XM.3H[/#T^/T!!0D-$149'2$E*2TQ-3D]045)35%565UA96EM<75Y?8$%"0T1%#
- XM1D=(24I+3$U.3U!14E-455976%E:>WQ]?G^`@8*#A(6&AXB)BHN,C8Z/D)&2L
- XMDY25EI>8F9J;G)V>GZ"AHJ.DI::GJ*FJJZRMKJ^PL;*SM+6VM[BYNKN\O;Z_U
- XMP,'"P\3%QL?(R<K+S,[.S]#1TM/4U=;7V-G:V]S=WM_@X>+CY.7FY^CIZNOL?
- XM[>[O\/'R\_3U]O?X^?K[_/W^_P```````0(#!`4&!P@)"@L,#0X/$!$2$Q05I
- XM%A<8&1H;'!T>'R`A(B,D)28G*"DJ*RPM+B\P,3(S-#4V-S@Y.CL\/3X_0&%B\
- XM8V1E9F=H:6IK;&UN;W!Q<G-T=79W>'EZ6UQ=7E]@86)C9&5F9VAI:FML;6YOE
- XM<'%R<W1U=G=X>7I[?'U^?X"!@H.$A8:'B(F*BXR-CH^0D9*3E)66EYB9FIN<.
- XMG9Z?H*&BHZ2EIJ>HJ:JKK*VNK["QLK.TM;:WN+FZN[R]OK_`P<+#Q,7&Q\C)W
- XMRLO,SL[/T-'2T]35UM?8V=K;W-W>W^#AXN/DY>;GZ.GJZ^SM[N_P\?+S]/7VA
- XM]_CY^OO\_?[_````2.<@`B(()``L;``F3J[_K$S?0`1.=4YQ+PXB`"QL`"9.S
- XMKO^F+%].=4CG(`(B`"0(+&P`)DZN_YI,WT`$3G5.<4CG(`(B`"0(+&P`)DZN=
- XM_Y1,WT`$3G5.<2\.(@`L;``F3J[_@BQ?3G4O#BQL`"9.KO]\+%].=4YQ+PXB*
- XM`"QL`"9.KO\N+%].=2\.+&P`(DZN_SHL7TYU3G$O#B)(+&P`(DZN_RXL7TYU&
- XM+PXL;``B3J[_"BQ?3G5.<2\.+&P`(DZN_O@L7TYU3G$O#B)(+&P`(DZN_MHL@
- XM7TYU+PXL;``B3J[^SBQ?3G5.<0```^P````7``````````8````*````$@``6
- XM`!H````B````)@```"H````N````,@```#8````Z````<````!8```"*````L
- XI/@```$(```!&````2@```$X```!2````5@```%H```!>`````````_**]
- X``
- Xend
- Xsize 8816
- END_OF_FILE
- if test 12387 -ne `wc -c <'sregexp.uu'`; then
- echo shar: \"'sregexp.uu'\" unpacked with wrong size!
- fi
- # end of 'sregexp.uu'
- fi
- if test -f 'sregexp_protos.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sregexp_protos.h'\"
- else
- echo shar: Extracting \"'sregexp_protos.h'\" \(607 characters\)
- sed "s/^X//" >'sregexp_protos.h' <<'END_OF_FILE'
- X
- X#ifndef LIBRARIES_SREGEXPBASE_H
- X#include <libraries/sregexpbase.h>
- X#endif
- X
- Xextern struct SregExpBase *SregExpBase;
- X
- Xextern struct SregExp * ParseSregExp(char *);
- Xextern void FreeSregExp(struct SregExp *);
- Xextern int MatchSregExp(char *, struct SregExp *, int);
- Xextern int MatchNSregExp(char *, struct SregExp *, int, int);
- Xextern int IsWild(char *);
- Xextern struct SpathInfo * AnchorPath(char *, char *);
- Xextern int NextFile(struct SpathInfo *, char *, int, int);
- Xextern int BuildPath(struct Spathinf *, char *, int);
- Xextern void FreeSpathInfo(struct SpathInfo *);
- X
- END_OF_FILE
- if test 607 -ne `wc -c <'sregexp_protos.h'`; then
- echo shar: \"'sregexp_protos.h'\" unpacked with wrong size!
- fi
- # end of 'sregexp_protos.h'
- fi
- if test -f 'sregexpbase.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sregexpbase.h'\"
- else
- echo shar: Extracting \"'sregexpbase.h'\" \(3432 characters\)
- sed "s/^X//" >'sregexpbase.h' <<'END_OF_FILE'
- X
- X/*
- X *
- X * sregexpbase.h -- C include file for sregexp.library
- X *
- X * Copyright (C) 1991, Jon Spencer.
- X *
- X * Created: April 20,1991
- X *
- X */
- X
- X#ifndef LIBRARIES_SREGEXPBASE_H
- X#define LIBRARIES_SREGEXPBASE_H
- X
- X#ifndef EXEC_TYPE_H
- X#include <exec/types.h>
- X#endif
- X
- X#ifndef EXEC_LISTS_H
- X#include <exec/lists.h>
- X#endif
- X
- X#ifndef EXEC_LIBRARIES_H
- X#include <exec/libraries.h>
- X#endif
- X
- X#ifndef LIBRARIES_DOS_H
- X#include <libraries/dos.h>
- X#endif
- X
- X
- X/*
- X *
- X * Library base structure, all of these fields are private, and
- X * should not be accessed.
- X *
- X */
- X
- Xstruct SregExpBase {
- X struct Library LibNode;
- X struct Library *SysBase;
- X struct Library *DOSBase;
- X BPTR Segment;
- X};
- X
- X#define SREGEXPNAME "sregexp.library"
- X
- X
- X/*
- X *
- X * Here are the defines for the structures used and returned by
- X * the various sreg functions. They should probably not be
- X * accessed for there contents, unless you have really good
- X * reason...
- X *
- X */
- X
- Xstruct SregExp {
- X char sre_Type,sre_Flag;
- X SHORT sre_MinLen;
- X union {
- X char onechar;
- X char *setchar;
- X char *string;
- X LONG number;
- X } sre_Data;
- X struct SregExp * sre_List[];
- X};
- X
- X
- X/* This is an internal structure for a singly linked list of sregexp's */
- Xstruct SregList {
- X struct SregExp *srl_sreg;
- X struct SregList *srl_next;
- X};
- X
- X
- X/* various types of wildcard pattern elements.
- X Goes in struct SregExp.type field */
- X
- X#define SRP_SETCHAR 1
- X#define SRP_ANYCHAR 2
- X#define SRP_ONECHAR 3
- X#define SRP_STRING 4
- X#define SRP_NULL 5
- X#define SRP_OR 6
- X#define SRP_SUM 7
- X
- X
- X
- X/* various flags to mark special properties of patterns.
- X Goes in struct SregExp.flag */
- X
- X#define SRF_NOT (1<<0)
- X#define SRF_REPEAT (1<<1)
- X#define SRF_FIXLEN (1<<2)
- X#define SRF_JUSTDIRS (1<<6) /* special flag used in path matching */
- X#define SRF_RECURSE (1<<7) /* dito. */
- X
- X/* defines for the wildcard characters */
- X
- X#define CHR_REPEAT '#'
- X#define CHR_NOT '~'
- X#define CHR_OPENBRACE '('
- X#define CHR_CLOSEBRACE ')'
- X#define CHR_OPENSET '['
- X#define CHR_CLOSESET ']'
- X#define CHR_ANYCHAR '?'
- X#define CHR_NULL '%'
- X#define CHR_OR '|'
- X#define CHR_ESCAPE '\''
- X#define CHR_RANGE '-'
- X#define CHR_STAR '*'
- X
- X
- X
- X
- X/* These are the structures used for the path matching routines. */
- X
- Xstruct SpathInfo {
- X struct SpathNode * spi_Head;
- X struct SpathNode * spi_Tail;
- X struct SpathNode * spi_TailPred;
- X struct SregList * spi_SregList;
- X};
- X
- X
- X/* Note: because of the fileinfoblock, this whole structure MUST
- X be longword aligned. */
- X
- Xstruct SpathNode {
- X struct SpathNode * spn_Succ;
- X struct SpathNode * spn_Pred;
- X struct FileInfoBlock spn_FIB;
- X BPTR spn_Lock;
- X struct SregList * spn_SregList;
- X char * spn_NodeName;
- X short int spn_Flags;
- X};
- X
- X/* flags used in spn_Flags, which is really library private */
- X#define SPF_DECEND (1<<0) /* Should recursively search, when we get the chance. */
- X#define SPF_DONEONCE (1<<1) /* Already done it, don't do again */
- X#define SPF_NEXTPARENT (1<<2) /* Next one is lock on parentdir */
- X
- X
- X/* These are the possible error returns sent by NextFile and BuildPath */
- X
- X#define SPE_ALL_DONE -1 /* no more matching files */
- X#define SPE_ERROR -2 /* some error occured, see IoErr() */
- X#define SPE_BUFF_FULL -3 /* you didn't give me enough room! */
- X#define SPE_SIGBREAK -4 /* A control signal came through. */
- X
- X
- X/* Some defines for what kind of events we match to. */
- X
- X#define SP_DIRS_ONLY 1
- X#define SP_BOTH 0
- X#define SP_FILES_ONLY -1
- X
- X#endif
- END_OF_FILE
- if test 3432 -ne `wc -c <'sregexpbase.h'`; then
- echo shar: \"'sregexpbase.h'\" unpacked with wrong size!
- fi
- # end of 'sregexpbase.h'
- fi
- if test -f 'sregexpbase.i' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sregexpbase.i'\"
- else
- echo shar: Extracting \"'sregexpbase.i'\" \(3339 characters\)
- sed "s/^X//" >'sregexpbase.i' <<'END_OF_FILE'
- X IFND LIBRARIES_SREGEXPBASE_I
- XLIBRARIES_SREGEXPBASE_I set 1
- X
- X*********************************************************************
- X* *
- X* sregbase.i -- asm include file for sreg.library *
- X* *
- X* Copyright (C) 1991, Jon Spencer. *
- X* *
- X* Created: April 20,1991 *
- X* *
- X*********************************************************************
- X
- X IFND EXEC_TYPES_I
- X INCLUDE "exec/types.i"
- X ENDC
- X
- X IFND EXEC_LISTS_I
- X INCLUDE "exec/lists.i"
- X ENDC
- X
- X IFND EXEC_LIBRARIES_I
- X INCLUDE "exec/libraries.i"
- X ENDC
- X
- X IFND LIBRARIES_DOS_I
- X INCLUDE "libraries/dos.i"
- X ENDC
- X
- X
- X
- X;
- X;
- X; Library base structure, all of these fields are private, and
- X; should not be accessed.
- X;
- X;
- X
- X STRUCTURE SregExpBase,LIB_SIZE
- X APTR sb_SysBase
- X APTR sb_DOSBase
- X ULONG sb_SegList
- X LABEL SregExpBase_SIZE
- X
- X
- X
- XSREGEXPNAME macro
- X dc.b "sregexp.library",0
- X endm
- X
- X;
- X;
- X; Here are the equates for the structures used and returned by
- X; the various sreg functions. They should probably not be
- X; accessed for there contents, unless you have really good
- X; reason...
- X;
- X;
- X STRUCTURE SregExp,0
- X BYTE sre_Type
- X BYTE sre_Flag
- X SHORT sre_MinLen
- X ULONG sre_Data
- X APTR sre_List
- X LABEL SregExp_SIZE
- X
- X
- X; sre_Data is a union, here are its elements.
- Xsre_onechar EQU sre_Data
- Xsre_setchar EQU sre_Data
- Xsre_string EQU sre_Data
- Xsre_number EQU sre_Data
- X
- X
- X; This is an internal structure for a singly linked list of sregexp's
- X
- X STRUCTURE SregList,0
- X APTR srl_sreg
- X APTR srl_next
- X LABEL SregList_SIZE
- X
- X
- X; various types of wildcard pattern elements. Goes in spat_t.type
- X
- XSRP_SETCHAR EQU 1
- XSRP_ANYCHAR EQU 2
- XSRP_ONECHAR EQU 3
- XSRP_STRING EQU 4
- XSRP_NULL EQU 5
- XSRP_OR EQU 6
- XSRP_SUM EQU 7
- X
- X; various flags to mark special properties of patterns.
- X; Goes in SregExp.sre_Flag
- X
- X BITDEF SR,NOT,0
- X BITDEF SR,REPEAT,1
- X BITDEF SR,FIXLEN,2
- X BITDEF SR,JUSTDIRS,6
- X BITDEF SR,RECURSE,7
- X
- X; equates for the wildcard characters
- X
- XCHR_REPEAT EQU '#'
- XCHR_NOT EQU '~'
- XCHR_OPENBRACE EQU '('
- XCHR_CLOSEBRACE EQU ')'
- XCHR_OPENSET EQU '['
- XCHR_CLOSESET EQU ']'
- XCHR_ANYCHAR EQU '?'
- XCHR_NULL EQU '%'
- XCHR_OR EQU '|'
- XCHR_ESCAPE EQU "'"
- XCHR_RANGE EQU '-'
- XCHR_STAR EQU '*'
- X
- X
- X;
- X; These are the structures used for the path matching routines.
- X;
- X
- X STRUCTURE SpathInfo,0
- X APTR spi_Head
- X APTR spi_Tail
- X APTR spi_TailPred
- X APTR spi_SregList;
- X LABEL SpathInfo_SIZE
- X
- X
- X; Note: because of the fileinfoblock, this whole structure MUST
- X; be longword aligned.
- X
- X STRUCTURE SpathNode,0
- X APTR spn_Succ
- X APTR spn_Pred
- X STRUCT spn_FIB,fib_SIZEOF
- X BPTR spn_Lock
- X APTR spn_SregList
- X APTR spn_NodeName
- X SHORT spn_Flags
- X LABEL SpathNode_SIZE
- X
- X; flags used in spn_Flags, which is really library private.
- X
- X BITDEF SP,DECEND,0
- X BITDEF SP,DONEONCE,1
- X BITDEF SP,NEXTPARENT,2
- X
- X; These are the possible error returns sent by NextFile and BuildPath
- X
- XSPE_ALL_DONE EQU -1
- XSPE_ERROR EQU -2
- XSPE_BUFF_FULL EQU -3
- XSPE_SIGBREAK EQU -4
- X
- X
- X; Some defines for what kind of events we match to.
- X
- XSP_DIRS_ONLY EQU 1
- XSP_BOTH EQU 0
- XSP_FILES_ONLY EQU -1
- X
- X ENDC
- END_OF_FILE
- if test 3339 -ne `wc -c <'sregexpbase.i'`; then
- echo shar: \"'sregexpbase.i'\" unpacked with wrong size!
- fi
- # end of 'sregexpbase.i'
- fi
- if test -f 'sregexps.uu' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sregexps.uu'\"
- else
- echo shar: Extracting \"'sregexps.uu'\" \(1705 characters\)
- sed "s/^X//" >'sregexps.uu' <<'END_OF_FILE'
- Xbegin 600 sregexps.lib
- XM```#YP````````/H`````````^D````%+PX@;P`(+&P``$ZN_^(L7TYU3G$`<
- XM``/OA@```U]3<F5G17AP0F%S90````$````(`0``!%]087)S95-R96=%>'``Y
- XM`````````````````_(```/G`````````^@````````#Z0````4O#B!O``@L[
- XM;```3J[_W"Q?3G5.<0```^^&```#7U-R96=%>'!"87-E`````0````@!```#P
- XM7T9R9653<F5G17AP``````````````/R```#YP````````/H`````````^D`5
- XM```&+PY,[P,```@@+P`0+&P``$ZN_]8L7TYU```#[X8```-?4W)E9T5X<$)A:
- XM<V4````!````#@$```1?36%T8VA3<F5G17AP``````````````````/R```#N
- XMYP````````/H`````````^D````'+PY,[P,```A,[P`#`!`L;```3J[_T"Q?$
- XM3G5.<0```^^&```#7U-R96=%>'!"87-E`````0```!`!```$7TUA=&-H3E-R*
- XM96=%>'`````````````````#\@```^<````````#Z`````````/I````!2\.Q
- XM(&\`""QL``!.KO_*+%].=4YQ```#[X8```-?4W)E9T5X<$)A<V4````!````5
- XM"`$```)?27-7:6QD```````````````#\@```^<````````#Z`````````/IL
- XM````!2\.3.\#```(+&P``$ZN_\0L7TYU```#[X8```-?4W)E9T5X<$)A<V4``
- XM```!````"@$```-?06YC:&]R4&%T:````````````````_(```/G````````U
- XM`^@````````#Z0````<O#DSO`P``"$SO``,`$"QL``!.KO^^+%].=4YQ```#0
- XM[X8```-?4W)E9T5X<$)A<V4````!````$`$```-?3F5X=$9I;&4`````````C
- XM`````````_(```/G`````````^@````````#Z0````8O#DSO`P``""`O`!`L*
- XM;```3J[_N"Q?3G4```/OA@```U]3<F5G17AP0F%S90````$````.`0```U]"T
- XM=6EL9%!A=&@````````````````#\@```^<````````#Z`````````/I````Q
- XM!2\.(&\`""QL``!.KO^R+%].=4YQ```#[X8```-?4W)E9T5X<$)A<V4````!_
- XM````"`$```1?1G)E95-P871H26YF;P````````````````/R```#YP``````9
- XM``/H`````````^D````````#[P(```5?3%9/1G)E95-P871H26YF;P```/__L
- XM_[("```$7TQ63T)U:6QD4&%T:````/___[@"```#7TQ63TYE>'1&:6QE____J
- XMO@(```1?3%9/06YC:&]R4&%T:```____Q`(```-?3%9/27-7:6QD``#____*E
- XM`@``!5],5D]-871C:$Y3<F5G17AP````____T`(```1?3%9/36%T8VA3<F5GQ
- XM17AP____U@(```1?3%9/1G)E95-R96=%>'``____W`(```1?3%9/4&%R<V533
- X2<F5G17AP____X@````````/R_
- X``
- Xend
- Xsize 1188
- END_OF_FILE
- if test 1705 -ne `wc -c <'sregexps.uu'`; then
- echo shar: \"'sregexps.uu'\" unpacked with wrong size!
- fi
- # end of 'sregexps.uu'
- fi
- if test -f 'sregexpsr.uu' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sregexpsr.uu'\"
- else
- echo shar: Extracting \"'sregexpsr.uu'\" \(1623 characters\)
- sed "s/^X//" >'sregexpsr.uu' <<'END_OF_FILE'
- Xbegin 600 sregexpsr.lib
- XM```#YP````````/H`````````^D````$+PXL;```3J[_XBQ?3G5.<0```^^&\
- XM```#7U-R96=%>'!"87-E`````0````0!```$0%!A<G-E4W)E9T5X<```````>
- XM```````````#\@```^<````````#Z`````````/I````!"\.+&P``$ZN_]PL2
- XM7TYU3G$```/OA@```U]3<F5G17AP0F%S90````$````$`0```T!&<F5E4W)EI
- XM9T5X<``````````````#\@```^<````````#Z`````````/I````!"\.+&P`C
- XM`$ZN_]8L7TYU3G$```/OA@```U]3<F5G17AP0F%S90````$````$`0``!$!-(
- XM871C:%-R96=%>'```````````````````_(```/G`````````^@````````#K
- XMZ0````0O#BQL``!.KO_0+%].=4YQ```#[X8```-?4W)E9T5X<$)A<V4````!N
- XM````!`$```1`36%T8VA.4W)E9T5X<`````````````````/R```#YP``````A
- XM``/H`````````^D````$+PXL;```3J[_RBQ?3G5.<0```^^&```#7U-R96=%R
- XM>'!"87-E`````0````0!```"0$ES5VEL9````````````````_(```/G````6
- XM`````^@````````#Z0````0O#BQL``!.KO_$+%].=4YQ```#[X8```-?4W)E`
- XM9T5X<$)A<V4````!````!`$```-`06YC:&]R4&%T:````````````````_(`U
- XM``/G`````````^@````````#Z0````0O#BQL``!.KO^^+%].=4YQ```#[X8`8
- XM``-?4W)E9T5X<$)A<V4````!````!`$```-`3F5X=$9I;&4`````````````#
- XM`````_(```/G`````````^@````````#Z0````0O#BQL``!.KO^X+%].=4YQ/
- XM```#[X8```-?4W)E9T5X<$)A<V4````!````!`$```-`0G5I;&10871H````9
- XM`````````````_(```/G`````````^@````````#Z0````0O#BQL``!.KO^R\
- XM+%].=4YQ```#[X8```-?4W)E9T5X<$)A<V4````!````!`$```1`1G)E95-PO
- XM871H26YF;P````````````````/R```#YP````````/H`````````^D`````_
- XM```#[P(```5?3%9/1G)E95-P871H26YF;P```/___[("```$7TQ63T)U:6QD,
- XM4&%T:````/___[@"```#7TQ63TYE>'1&:6QE____O@(```1?3%9/06YC:&]RB
- XM4&%T:```____Q`(```-?3%9/27-7:6QD``#____*`@``!5],5D]-871C:$Y3;
- XM<F5G17AP````____T`(```1?3%9/36%T8VA3<F5G17AP____U@(```1?3%9/B
- XM1G)E95-R96=%>'``____W`(```1?3%9/4&%R<V53<F5G17AP____X@``````'
- X#``/RU
- X``
- Xend
- Xsize 1128
- END_OF_FILE
- if test 1623 -ne `wc -c <'sregexpsr.uu'`; then
- echo shar: \"'sregexpsr.uu'\" unpacked with wrong size!
- fi
- # end of 'sregexpsr.uu'
- fi
- if test ! -d 'utils' ; then
- echo shar: Creating directory \"'utils'\"
- mkdir 'utils'
- fi
- if test -f 'utils/bumprev.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'utils/bumprev.c'\"
- else
- echo shar: Extracting \"'utils/bumprev.c'\" \(1133 characters\)
- sed "s/^X//" >'utils/bumprev.c' <<'END_OF_FILE'
- X
- X#include <stdio.h>
- X#include <string.h>
- X#include <ctype.h>
- X#include <stdlib.h>
- X
- Xint
- Xmain(ac,av)
- Xint ac;
- Xchar **av;
- X{
- X FILE *fp;
- X int i = 0,r,v,f=0;
- X char buff[100],*line[100],*p;
- X
- X if (ac == 2 && strcmp(av[1],"-v") == 0)
- X f = 1;
- X if (!(fp = fopen("sreg_version.i","r+"))) {
- X puts("Unable to open input.");
- X return 30;
- X }
- X
- X while (fgets(buff,100,fp) == buff)
- X line[i++] = strdup(buff);
- X line[i] = NULL;
- X
- X fseek(fp,0,SEEK_SET);
- X for (i = 0; line[i]; i++) {
- X if (strncmp(line[i],"VERSION",7) == 0) {
- X p = line[i];
- X while (!isdigit(*p)) p++;
- X v = atoi(p);
- X if (f) {
- X v++;
- X sprintf(p,"%d\n",v);
- X }
- X } else
- X if (strncmp(line[i],"REVISION",8) == 0) {
- X p = line[i];
- X while (!isdigit(*p)) p++;
- X r = atoi(p)+1;
- X if (f)
- X r = 0;
- X sprintf(p,"%d\n",r);
- X }
- X fputs(line[i],fp);
- X }
- X fclose(fp);
- X if (!(fp = fopen("sreg_version.c","w"))) {
- X puts("Unable to open c file.");
- X return 10;
- X }
- X fprintf(fp,
- X"\n\nconst __far char idString[] = \"sreglib %d.%d (\"__DATE__\")\\x0d\\x0a\";\n"
- X,v,r);
- X fclose(fp);
- X printf("Up to version %d.%d\n",v,r);
- X return 0;
- X}
- END_OF_FILE
- if test 1133 -ne `wc -c <'utils/bumprev.c'`; then
- echo shar: \"'utils/bumprev.c'\" unpacked with wrong size!
- fi
- # end of 'utils/bumprev.c'
- fi
- if test -f 'utils/remlib.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'utils/remlib.c'\"
- else
- echo shar: Extracting \"'utils/remlib.c'\" \(523 characters\)
- sed "s/^X//" >'utils/remlib.c' <<'END_OF_FILE'
- X
- X#include <exec/types.h>
- X#include <exec/libraries.h>
- X#include <clib/exec_protos.h>
- X#include <exec/execbase.h>
- X#include <stdio.h>
- X#include <stdlib.h>
- X
- Xextern struct ExecBase *SysBase;
- X
- Xint
- Xmain(ac,av)
- Xint ac;
- Xchar **av;
- X{
- X struct Library *found;
- X
- X if (ac != 2) {
- X puts("Use: remlib <library name>");
- X return 10;
- X }
- X
- X Forbid();
- X if (found = (struct Library *)FindName(&SysBase->LibList,av[1]))
- X RemLibrary(found);
- X Permit();
- X if (!found)
- X return 5;
- X puts("OK, hopefully it is gone.");
- X return 0;
- X}
- END_OF_FILE
- if test 523 -ne `wc -c <'utils/remlib.c'`; then
- echo shar: \"'utils/remlib.c'\" unpacked with wrong size!
- fi
- # end of 'utils/remlib.c'
- fi
- if test -f 'utils/try.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'utils/try.c'\"
- else
- echo shar: Extracting \"'utils/try.c'\" \(1636 characters\)
- sed "s/^X//" >'utils/try.c' <<'END_OF_FILE'
- X
- X#include "sregexpbase.h"
- X#include "sregexp_protos.h"
- X#include <libraries/dos.h>
- X#include <clib/exec_protos.h>
- X#include <clib/dos_protos.h>
- X#include <string.h>
- X#include <assert.h>
- X#include <stdlib.h>
- X
- Xstruct SregExpBase *SregExpBase;
- X
- Xvoid
- Xputs(c)
- Xchar *c;
- X{
- Xchkabort();
- X Write(Output(),c,strlen(c));
- X Write(Output(),"\n",1);
- X}
- X
- X#include <stdarg.h>
- X
- Xextern void vsprintf(char *, char *, va_list);
- X
- Xvoid printf(f, ...)
- Xchar *f;
- X{
- X char buff[100];
- X va_list va;
- X
- Xchkabort();
- X va_start(va,f);
- X vsprintf(buff,f,va);
- X va_end(va);
- X Write(Output(),buff,strlen(buff));
- X}
- X
- Xint
- Xbrk()
- X{ /* Don't worry about lost memory for now... */
- X
- XWrite(Output(),"BREAK\n",6);
- X CloseLibrary(SregExpBase);
- X return 1;
- X
- X}
- X
- Xint
- Xmain(ac,av)
- Xint ac;
- Xchar *av;
- X{
- X struct SregExp *pat;
- X struct SpathInfo *spi;
- X char buff[300],fb[110];
- X BPTR lock;
- X
- X if (!(SregExpBase = OpenLibrary("sregexp.library",0))) {
- X puts("Unable to open library.");
- X return 5;
- X }
- X onbreak(brk);
- X
- X pat = ParseSregExp("sys:docs/#?/&(#?)");
- X if (!pat) {
- X printf("%d\n",IoErr());
- X CloseLibrary(SregExpBase);
- X exit(1);
- X }
- X
- X if (MatchSregExp("hello dog",pat,1))
- X puts("right");
- X else
- X puts("wrong");
- X
- X if (MatchSregExp("hello Dog",pat,1))
- X puts("right");
- X else
- X puts("wrong");
- X
- X if (MatchSregExp("hello Dog",pat,0))
- X puts("right");
- X else
- X puts("wrong");
- X
- X if (MatchSregExp("hello cat",pat,1))
- X puts("right");
- X else
- X puts("wrong");
- X
- X FreeSregExp(pat);
- X
- X if (!(spi = AnchorPath("","sys:docs/#?/&(.doc|.txt|"))) {
- X printf("%d\n",IoErr());
- X CloseLibrary(SregExpBase);
- X exit(1);
- X }
- X
- X FreeSpathInfo(spi);
- X}
- END_OF_FILE
- if test 1636 -ne `wc -c <'utils/try.c'`; then
- echo shar: \"'utils/try.c'\" unpacked with wrong size!
- fi
- # end of 'utils/try.c'
- fi
- echo shar: End of archive 1 \(of 2\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked both archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
- --
- Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
- Mail comments to the moderator at <amiga-request@uunet.uu.net>.
- Post requests for sources, and general discussion to comp.sys.amiga.misc.
-